package com.nkym.wypan.model.req.user;/*
 * @ClassName UserRegisterReq
 * @Desc TODO
 * @Author 19637
 * @Date 2023/6/5 22:43
 * @Version 1.0
 */

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class UserRegisterReq implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^[0-9A-Za-z]{6,16}$", message = "请输入6-16位只包含数字和英文字母的用户名")
    private String username;

    @NotBlank(message = "密码不能为空")
    @Length(max = 16, min = 8, message = "请输入8-16位密码")
    private String password;

    @NotBlank(message = "密保问题不能为空")
    @Length(max = 100, message = "密保问题不能超过100个字符")
    private String question;

    @NotBlank(message = "密保答案不能为空")
    @Length(max = 100, message = "密保答案不能超过100个字符")
    private String answer;

}
